1. Field of the Invention
The present invention relates to a print control apparatus and method of compressing/expanding image data and printing it.
2. Related Background Art
A data compression method called a pack bit data compression method is known for compressing image data transmitted from an information processing apparatus such as a host computer to a print control apparatus.
With the pack bit data compression method, image data of each byte is checked whether or not it is formed by the same data elements. As shown in FIG. 10A, if the image data of each byte is formed by the same data elements, the number of bytes of the same data elements is written in a one byte control unit 51, and the same data element byte which occurs that number of times is written in a one byte data unit 52. If the image data of each byte is formed by different data elements, as shown in FIG. 10B, the number of bytes of the different data elements is written in a one byte control unit 53, and the different data elements of one or more bytes are written in a data unit 54 containing those one or more bytes.
FIG. 11A shows an example of non-compressed image data transmitted from the host computer, the image data being shown in units of bytes. FIG. 11B shows the non-compressed image data shown in FIG. 11A, as compressed by the pack bit compression method. With the pack bit compression method, immediately before the two bytes of different data "A" and "B", control data "command 1" indicating the number (two) of bytes of different data elements is written. Immediately before five consecutive bytes of the same image data "C", control data "command 2" indicating the number of bytes (five) of the same data elements is written. Similarly, control data indicating the number of bytes of the same or different data elements is written immediately before each such byte or set of bytes.
With the conventional pack bit compression method used with a print control apparatus, however, in order to count the number of bytes of different data elements transmitted from the host computer, it is necessary to temporarily store the bytes of different data elements in a buffer or a memory area different from the data unit 54, and to transfer the bytes stored in the buffer or the like to the data unit 54 after the control data indicating the number of counted bytes is written in the control unit 53. Specifically, in the example shown in FIG. 11B, in order to generate the control data "command 6" indicating the number of bytes of different data elements "G", "H", "I", and "J", it is necessary to detect a transition from bytes of the different data elements to bytes of same data elements. Therefore, after the different data elements "G", "H", "I", and "J" are received, it is necessary to receive a plurality of bytes of the same data elements "K" in order to detect the transition and generate the control data "command 6". A buffer having a capacity sufficient for temporarily storing image data becomes necessary, increasing the load on the apparatus.
In another method of counting the number of bytes of different data elements, the image data is written in the data unit 54 by DMA (direct memory access) without writing the control data in the control unit 53, and when a transition is detected, the address is returned to the control unit 53 to write the control data therein. With this method, however, to write the control data in the control unit 53 in this fashion (after writing the image data in the data unit 54), it is necessary to control the write address counter to return to the address of the control unit 53. This method therefore requires a complicated operation.